fix(ai): move @standard-schema/spec to dependencies (closes #602)#615
Conversation
The package's published .d.ts files import types from @standard-schema/spec, so it must be a runtime dependency for consumers' type resolution to work. With skipLibCheck: true, tsc silently ignored the unresolved module, but type-aware tools like @typescript-eslint (with recommendedTypeChecked / projectService: true) failed to resolve return types - surfacing as "Unsafe assignment of an error typed value" on useChat() destructuring and cascading errors through downstream usages.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR moves ChangesMove
🎯 1 (Trivial) | ⏱️ ~5 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Changeset Version Preview1 package(s) bumped directly, 18 bumped as dependents. 🟩 Patch bumps
|
|
View your CI Pipeline Execution ↗ for commit ef026fb
☁️ Nx Cloud last updated this comment at |
@tanstack/ai
@tanstack/ai-anthropic
@tanstack/ai-client
@tanstack/ai-code-mode
@tanstack/ai-code-mode-skills
@tanstack/ai-devtools-core
@tanstack/ai-elevenlabs
@tanstack/ai-event-client
@tanstack/ai-fal
@tanstack/ai-gemini
@tanstack/ai-grok
@tanstack/ai-groq
@tanstack/ai-isolate-cloudflare
@tanstack/ai-isolate-node
@tanstack/ai-isolate-quickjs
@tanstack/ai-ollama
@tanstack/ai-openai
@tanstack/ai-openrouter
@tanstack/ai-preact
@tanstack/ai-react
@tanstack/ai-react-ui
@tanstack/ai-solid
@tanstack/ai-solid-ui
@tanstack/ai-svelte
@tanstack/ai-utils
@tanstack/ai-vue
@tanstack/ai-vue-ui
@tanstack/openai-base
@tanstack/preact-ai-devtools
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
commit: |
Summary
@standard-schema/specfromdevDependenciestodependenciesin@tanstack/ai..d.tsfiles (types.d.ts,activities/chat/tools/tool-definition.d.ts,activities/chat/tools/schema-converter.d.ts)import typefrom@standard-schema/spec, so consumers need it installed for type resolution to succeed.Why this matters
With
skipLibCheck: true,tscsilently ignores the unresolved module reference inside.d.tsfiles. But type-aware tools like@typescript-eslint(withrecommendedTypeChecked/projectService: true) follow the full type chain. When it hits the missing module, the entire type resolution foruseChat()fails, producing an "error type" that cascades through all usages:The dep is also pulled in transitively by all framework packages (
ai-react,ai-solid,ai-svelte,ai-vue,ai-client) since they re-export types from@tanstack/ai.Test plan
pnpm test:sherif— workspace dep consistency passespnpm test:knip— no unused dep flaggedpnpm --filter @tanstack/ai test:types— type check passespnpm --filter @tanstack/ai test:lib— 899 tests passpnpm --filter @tanstack/ai test:build— publint passespnpm test:eslint— lint passes across affected projectsNo behavior change — packaging fix only.
Closes #602.
Summary by CodeRabbit
@standard-schema/spec(v1.1.0+) has been moved from dev dependencies to runtime dependencies.